//
//  OrdineDVStaticViewController.h
//  iTeVe
//
//  Created by Pedro Gonzalez on 26/02/14.
//  Copyright (c) 2014 SISI Software. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Testa.h"
#import "Cliente.h"
#import "Pagamento.h"
#import "BSKeyboardControls.h"
#import "ClientiScegliVC.h"
#import "OrdineRigheVC.h"


@class OrdineDVStaticViewController;

@protocol OrdineDVStaticViewControllerDelegate <NSObject>

- (void)ordineDVStaticViewControllerDidCancel:(OrdineDVStaticViewController *)controller;
- (void)ordineDVStaticViewController:(OrdineDVStaticViewController *)controller didEditOrdine:(Testa *)ordine;
- (void)ordineDVStaticViewController:(OrdineDVStaticViewController *)controller didAddOrdine:(Testa *)ordine;

@end



@interface OrdineDVStaticViewController : UITableViewController <ClientiScegliVCDelegate, OrdineRigheVCDelegate>
{
    UIPickerView *documentiPicker;
    UIToolbar    *accessoryView;
    NSMutableArray *tipimov;
}

@property (nonatomic, weak) NSObject<OrdineDVStaticViewControllerDelegate> *delegate;

- (IBAction)cancel:(id)sender;
- (IBAction)done:(id)sender;

@property (weak, nonatomic) IBOutlet UIBarButtonItem *btnAnnulla;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *btnConferma;


@property (weak, nonatomic) IBOutlet UILabel *lblRagioneSociale;
@property (weak, nonatomic) IBOutlet UILabel *lblIndirizzo;
@property (weak, nonatomic) IBOutlet UILabel *lblTelefonoFaxCell;
@property (weak, nonatomic) IBOutlet UILabel *lblPagamento;
@property (weak, nonatomic) IBOutlet UILabel *lblSconti;
@property (weak, nonatomic) IBOutlet UILabel *lblListino;
@property (weak, nonatomic) IBOutlet UILabel *lblDataDocumento;
@property (weak, nonatomic) IBOutlet UILabel *lblTotaleDocumento;
@property (weak, nonatomic) IBOutlet UILabel *lblPivaCF;
@property (weak, nonatomic) IBOutlet UILabel *lblNoteDocumento;
@property (weak, nonatomic) IBOutlet UILabel *lblNoteCliente;

@property (nonatomic, strong) IBOutlet UITextField *tfRagioneSociale;
@property (weak, nonatomic) IBOutlet UITextField *tfPivaCF;

@property (nonatomic, strong) IBOutlet UITextField *tfIndirizzo;
@property (nonatomic, strong) IBOutlet UITextField *tfCap;
@property (nonatomic, strong) IBOutlet UITextField *tfCitta;
@property (nonatomic, strong) IBOutlet UITextField *tfProvincia;
@property (nonatomic, strong) IBOutlet UITextField *tfNazione;
@property (nonatomic, strong) IBOutlet UITextField *tfTelefono;
@property (weak, nonatomic) IBOutlet UITextField *tfPagamento;
@property (nonatomic, strong) IBOutlet UITextField *tfFax;
@property (nonatomic, strong) IBOutlet UITextField *tfCellulare;
@property (nonatomic, strong) IBOutlet UITextField *tfSc1;
@property (nonatomic, strong) IBOutlet UITextField *tfSc2;
@property (nonatomic, strong) IBOutlet UITextField *tfSc3;
@property (nonatomic, strong) IBOutlet UITextField *tfSc4;
@property (nonatomic, strong) IBOutlet UITextField *tfListino;
@property (nonatomic, strong) IBOutlet UITextField *tfAgente;
@property (weak, nonatomic) IBOutlet UITextField *tfDataDocumento;
@property (weak, nonatomic) IBOutlet UITextField *tfTotaleDocumento;
@property (weak, nonatomic) IBOutlet UITextView *tvNoteDocumento;
@property (weak, nonatomic) IBOutlet UITextView *tvNoteCliente;
@property (weak, nonatomic) IBOutlet UITextField *tfCodMovimento;
@property (weak, nonatomic) IBOutlet UITextField *tfMovimento;

@property (nonatomic, strong) UITextField *activeField;

@property (nonatomic, assign) NSInteger selectedIndex;


@property (nonatomic, strong) Testa *modelTesta;
@property (nonatomic, strong) Cliente *modelCliente;
@property (nonatomic, strong) NSMutableArray *modelDettaglio;

@property (nonatomic) BOOL nuovo;

@property (weak, nonatomic) IBOutlet UIButton *btnScegliecliente;

@property (nonatomic, readonly) UIToolbar *accessoryView;

@end
